var mongoose = require('mongoose')
var Schema = mongoose.Schema
mongoose.connect('mongodb://localhost/BBETTER')
var bookSchema = new Schema({
    name: {
        type: String,
        required: true
    },
    cluster: {
        type: String,
        required: true
    },
    denominator: {
        type: Number,
        required: true
    },
    numerator: {
        type: Number,
        required: false
    },
    today: {
        type: Number,
        required: false
    },
    desc: {
        type: [{
            text: {
                type: String
            },
            today: {
                type: Number
            },
            time: {
                type: String
            }
        }],
        required: false
    },
})

module.exports = mongoose.model('BookDetail', bookSchema)